<!DOCTYPE html>
<html>

<head>
  <meta charset="utf-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
  <meta name="renderer" content="webkit">
  <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no">
  <link rel="icon" href="/admin/">
  <title>

  </title>
  <style>
    html,
    body,
    #app {
      height: 100%;
      margin: 0px;
      padding: 0px;
    }
  </style>
</head>

<body>
  <div id="app">
    <div style="display: flex;align-items: center;justify-content: center;padding-top: 50px">
      <div>
        <div id="imgPlace">

        </div>
        <div style="text-align: center" id="sampleNo">

        </div>
      </div>
    </div>
  </div>
</body>
<script>
  function queryUrlParams (url) {
    const urlStr = url.split('?')[1]
    const obj = {}
    const paramsArr = urlStr.split('&')
    paramsArr.forEach(p => {
      const arr = p.split('=')
      obj[arr[0]] = arr[1]
    })
    return obj
  }
  console.log()
  var img = new Image()
  img.src = 'http://ca.singlera.com.cn/bics-admin/form/showBarCode/' + queryUrlParams(window.location.href).sampleNo
  document.getElementById('imgPlace').append(img)
  document.getElementById('sampleNo').innerHTML = queryUrlParams(window.location.href).sampleNo
  setTimeout(() => {
    window.print()
  }, 500)
</script>
</html>
